# Contributor: Jeff Dickey <release@chim.sh>
# Maintainer: Jeff Dickey <release@chim.sh>
pkgname=chim
pkgver=1.1.2
pkgrel=1
pkgdesc="Cross-platform binary shims with optional remote fetching."
url="https://chim.sh"
arch="all !s390x !riscv64 !ppc64le" # limited by cargo
license="MIT"
makedepends="
	bzip2-dev
	cargo
	cargo-auditable
	xz-dev
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jdxcode/chim/archive/refs/tags/v$pkgver.tar.gz"


prepare() {
	default_prepare

	git init .
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm0755 target/release/"$pkgname" -t "$pkgdir"/usr/bin
	install -Dm0644 README.md -t "$pkgdir"/usr/share/doc/"$pkgname"
}

sha512sums="
8068c4ac56df1f8bd7cf75a189bf3b773fdbe35733dc430261c41f4400c91a092ee2c30d03cd7936d1775477ba7f2479098eee09a218f766a1698e09b19cdda6  chim-1.1.2.tar.gz
"
